package com.weitu.permission.user.entity;

import com.weitu.permission.department.entity.Department;

import java.io.Serializable;
import java.util.List;

/**
 * Table: SYS_USER
 */
public class User implements Serializable {
    /**
     * Id
     * Column: SYS_USER.id
     */
    private String id;

    /**
     * 用户编号
     * Column: SYS_USER.code
     */
    private String code;

    /**
     * 用户名
     * Column: SYS_USER.name
     */
    private String name;

    /**
     * 姓名
     * Column: SYS_USER.realName
     */
    private String realName;

    /**
     * 密码
     * Column: SYS_USER.password
     */
    private String password;

    /**
     * 加密盐
     * Column: SYS_USER.credentialsSalt
     */
    private String credentialsSalt;

    /**
     * 岗位id
     * Column: SYS_USER.postId
     */
    private String postId;

    /**
     * 岗位名称
     */
    private String postName;

    /**
     * 备注
     * Column: SYS_USER.remarks
     */
    private String remarks;

    /**
     * 删除状态（0未删除，1已删除）
     * Column: SYS_USER.delState
     */
    private Integer delState;

    /**
     * 是否启用（0不启用，1启用）
     * Column: SYS_USER.useState
     */
    private Integer useState;

    /**
     * 排序标识
     * Column: SYS_USER.sort
     */
    private Integer sort;

    /**
     * 添加人id
     * Column: SYS_USER.addUserId
     */
    private String addUserId;

    /**
     * 添加时间
     * Column: SYS_USER.addTime
     */
    private String addTime;

    /**
     * 修改人id
     * Column: SYS_USER.updateUserId
     */
    private String updateUserId;

    /**
     * 修改时间
     * Column: SYS_USER.updateTime
     */
    private String updateTime;

    /**
     * 修改人
     * Column: SYS_USER
     */
    private User updateUser;

    /**
     * 添加人
     * Column: SYS_USER
     */
    private User addUser;

    /**
     * 所属部门
     * Column: SYS_DEPARTMENT
     */
    private Department department;

    /**
     * 用户部门关联
     * Column: SYS_DEPARTMENT
     */
    private List<UserDepartment> userDepartmentList;

    /**
     * 用户职位关联
     * Column: SYS_USER_DUTY
     */
    private List<UserDuty> userDutyList;

    /**
     * 用户职位关联
     * Column: SYS_USER_ROLE
     */
    private List<UserRole> userRoleList;

    private UserInfo userInfo;

    private static final long serialVersionUID = 1L;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id == null ? null : id.trim();
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code == null ? null : code.trim();
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name == null ? null : name.trim();
    }

    public String getRealName() {
        return realName;
    }

    public void setRealName(String realName) {
        this.realName = realName == null ? null : realName.trim();
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password == null ? null : password.trim();
    }

    public String getCredentialsSalt() {
        return credentialsSalt;
    }

    public void setCredentialsSalt(String credentialsSalt) {
        this.credentialsSalt = credentialsSalt == null ? null : credentialsSalt.trim();
    }

    public String getPostId() {
        return postId;
    }

    public void setPostId(String postId) {
        this.postId = postId == null ? null : postId.trim();
    }

    public String getPostName() {
        return postName;
    }

    public void setPostName(String postName) {
        this.postName = postName;
    }

    public String getRemarks() {
        return remarks;
    }

    public void setRemarks(String remarks) {
        this.remarks = remarks == null ? null : remarks.trim();
    }

    public Integer getDelState() {
        return delState;
    }

    public void setDelState(Integer delState) {
        this.delState = delState;
    }

    public Integer getUseState() {
        return useState;
    }

    public void setUseState(Integer useState) {
        this.useState = useState;
    }

    public Integer getSort() {
        return sort;
    }

    public void setSort(Integer sort) {
        this.sort = sort;
    }

    public String getAddUserId() {
        return addUserId;
    }

    public void setAddUserId(String addUserId) {
        this.addUserId = addUserId == null ? null : addUserId.trim();
    }

    public String getAddTime() {
        return addTime;
    }

    public void setAddTime(String addTime) {
        this.addTime = addTime == null ? null : addTime.trim();
    }

    public String getUpdateUserId() {
        return updateUserId;
    }

    public void setUpdateUserId(String updateUserId) {
        this.updateUserId = updateUserId == null ? null : updateUserId.trim();
    }

    public String getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(String updateTime) {
        this.updateTime = updateTime == null ? null : updateTime.trim();
    }

    public User getUpdateUser() {
        return updateUser;
    }

    public void setUpdateUser(User updateUser) {
        this.updateUser = updateUser;
    }

    public User getAddUser() {
        return addUser;
    }

    public void setAddUser(User addUser) {
        this.addUser = addUser;
    }

    public List<UserDepartment> getUserDepartmentList() {
        return userDepartmentList;
    }

    public void setUserDepartmentList(List<UserDepartment> userDepartmentList) {
        this.userDepartmentList = userDepartmentList;
    }

    public List<UserDuty> getUserDutyList() {
        return userDutyList;
    }

    public void setUserDutyList(List<UserDuty> userDutyList) {
        this.userDutyList = userDutyList;
    }

    public List<UserRole> getUserRoleList() {
        return userRoleList;
    }

    public void setUserRoleList(List<UserRole> userRoleList) {
        this.userRoleList = userRoleList;
    }

    public Department getDepartment() {
        return department;
    }

    public void setDepartment(Department department) {
        this.department = department;
    }

    public UserInfo getUserInfo() {
        return userInfo;
    }

    public void setUserInfo(UserInfo userInfo) {
        this.userInfo = userInfo;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        User user = (User) o;

        if (id != null ? !id.equals(user.id) : user.id != null) return false;
        if (code != null ? !code.equals(user.code) : user.code != null) return false;
        if (name != null ? !name.equals(user.name) : user.name != null) return false;
        if (realName != null ? !realName.equals(user.realName) : user.realName != null) return false;
        if (password != null ? !password.equals(user.password) : user.password != null) return false;
        if (credentialsSalt != null ? !credentialsSalt.equals(user.credentialsSalt) : user.credentialsSalt != null)
            return false;
        if (postId != null ? !postId.equals(user.postId) : user.postId != null) return false;
        if (postName != null ? !postName.equals(user.postName) : user.postName != null) return false;
        if (remarks != null ? !remarks.equals(user.remarks) : user.remarks != null) return false;
        if (delState != null ? !delState.equals(user.delState) : user.delState != null) return false;
        if (useState != null ? !useState.equals(user.useState) : user.useState != null) return false;
        if (sort != null ? !sort.equals(user.sort) : user.sort != null) return false;
        if (addUserId != null ? !addUserId.equals(user.addUserId) : user.addUserId != null) return false;
        if (addTime != null ? !addTime.equals(user.addTime) : user.addTime != null) return false;
        if (updateUserId != null ? !updateUserId.equals(user.updateUserId) : user.updateUserId != null) return false;
        if (updateTime != null ? !updateTime.equals(user.updateTime) : user.updateTime != null) return false;
        if (updateUser != null ? !updateUser.equals(user.updateUser) : user.updateUser != null) return false;
        if (addUser != null ? !addUser.equals(user.addUser) : user.addUser != null) return false;
        if (department != null ? !department.equals(user.department) : user.department != null) return false;
        if (userDepartmentList != null ? !userDepartmentList.equals(user.userDepartmentList) : user.userDepartmentList != null)
            return false;
        if (userDutyList != null ? !userDutyList.equals(user.userDutyList) : user.userDutyList != null) return false;
        if (userRoleList != null ? !userRoleList.equals(user.userRoleList) : user.userRoleList != null) return false;
        return userInfo != null ? userInfo.equals(user.userInfo) : user.userInfo == null;
    }

    @Override
    public int hashCode() {
        int result = id != null ? id.hashCode() : 0;
        result = 31 * result + (code != null ? code.hashCode() : 0);
        result = 31 * result + (name != null ? name.hashCode() : 0);
        result = 31 * result + (realName != null ? realName.hashCode() : 0);
        result = 31 * result + (password != null ? password.hashCode() : 0);
        result = 31 * result + (credentialsSalt != null ? credentialsSalt.hashCode() : 0);
        result = 31 * result + (postId != null ? postId.hashCode() : 0);
        result = 31 * result + (postName != null ? postName.hashCode() : 0);
        result = 31 * result + (remarks != null ? remarks.hashCode() : 0);
        result = 31 * result + (delState != null ? delState.hashCode() : 0);
        result = 31 * result + (useState != null ? useState.hashCode() : 0);
        result = 31 * result + (sort != null ? sort.hashCode() : 0);
        result = 31 * result + (addUserId != null ? addUserId.hashCode() : 0);
        result = 31 * result + (addTime != null ? addTime.hashCode() : 0);
        result = 31 * result + (updateUserId != null ? updateUserId.hashCode() : 0);
        result = 31 * result + (updateTime != null ? updateTime.hashCode() : 0);
        result = 31 * result + (updateUser != null ? updateUser.hashCode() : 0);
        result = 31 * result + (addUser != null ? addUser.hashCode() : 0);
        result = 31 * result + (department != null ? department.hashCode() : 0);
        result = 31 * result + (userDepartmentList != null ? userDepartmentList.hashCode() : 0);
        result = 31 * result + (userDutyList != null ? userDutyList.hashCode() : 0);
        result = 31 * result + (userRoleList != null ? userRoleList.hashCode() : 0);
        result = 31 * result + (userInfo != null ? userInfo.hashCode() : 0);
        return result;
    }

    @Override
    public String toString() {
        return "User{" +
                "id='" + id + '\'' +
                ", code='" + code + '\'' +
                ", name='" + name + '\'' +
                ", realName='" + realName + '\'' +
                ", password='" + password + '\'' +
                ", credentialsSalt='" + credentialsSalt + '\'' +
                ", postId='" + postId + '\'' +
                ", postName='" + postName + '\'' +
                ", remarks='" + remarks + '\'' +
                ", delState=" + delState +
                ", useState=" + useState +
                ", sort=" + sort +
                ", addUserId='" + addUserId + '\'' +
                ", addTime='" + addTime + '\'' +
                ", updateUserId='" + updateUserId + '\'' +
                ", updateTime='" + updateTime + '\'' +
                ", updateUser=" + updateUser +
                ", addUser=" + addUser +
                ", department=" + department +
                ", userDepartmentList=" + userDepartmentList +
                ", userDutyList=" + userDutyList +
                ", userRoleList=" + userRoleList +
                ", userInfo=" + userInfo +
                '}';
    }
}